#ifndef DW_BASE_CONFIG_AUTO_DETECT_H
#	define DW_BASE_CONFIG_AUTO_DETECT_H

//! Auto-detect platform
#if defined(_WIN32) || defined(WIN32)
#	define DW_PLATFORM_AUTODETECT     DW_PLATFORM_WIN32
#elif defined(_WIN64) || defined(WIN64)
#	define DW_PLATFORM_AUTODETECT     DW_PLATFORM_WIN64
#elif defined (_XBOX_VER)
#	if (_XBOX_VER >= 200)
#		define DW_PLATFORM_AUTODETECT DW_PLATFORM_XENON
#	else
#	error "Can't autodetect platform XBOX platform!"
#	endif
#elif defined(__CELLOS_LV2__)
#	if defined(__PPU__) || defined(PPU) || defined(SN_TARGET_PS3)
#		define DW_PLATFORM_AUTODETECT DW_PLATFORM_PS3_PPU
#	elif defined(__SPU__) || defined(SPU) || defined(SN_TARGET_PS3_SPU)
#		define DW_PLATFORM_AUTODETECT DW_PLATFORM_PS3_SPU
#	else
#		error "Can't autodetect platform PS3 platform!"
#	endif
#else
#	error "Can't autodetect platform!"
#endif

//! Auto-detect configuration
#if defined(_DEBUG) || defined(DW_DEBUG)
#	define DW_CONFIG_AUTODETECT DW_CONFIG_DEBUG
#elif defined(DW_MASTER)
#	define DW_CONFIG_AUTODETECT DW_CONFIG_MASTER
#else 
#	define DW_CONFIG_AUTODETECT DW_CONFIG_RELEASE
#endif

//! Auto-detect compiler
#if (DW_PLATFORM_AUTODETECT == DW_PLATFORM_WIN32 || DW_PLATFORM_AUTODETECT == DW_PLATFORM_WIN64 || DW_PLATFORM_AUTODETECT == DW_PLATFORM_XENON)
#	if defined(__INTEL_COMPILER) // Intel C++ Compiler
#		define DW_COMPILER_AUTODETECT     DW_COMPILER_INTEL
#	elif defined(_MSC_VER) // Microsoft Visual C++
#		if _MSC_VER >= 1600
#			define DW_COMPILER_AUTODETECT DW_COMPILER_VC10
#		elif _MSC_VER >= 1500
#			define DW_COMPILER_AUTODETECT DW_COMPILER_VC09
#		elif _MSC_VER >= 1400
#			define DW_COMPILER_AUTODETECT DW_COMPILER_VC08
#		elif _MSC_VER >= 1300
#			define DW_COMPILER_AUTODETECT DW_COMPILER_VC07
#		else
#			error "Unsupported compiler: Microsoft Visual C++ 6 or below"
#		endif
#	else
#		error "Unsupported compiler: Unable to autodetect compiler"
#	endif
#elif (DW_PLATFORM_AUTODETECT == DW_PLATFORM_PS3_PPU && defined(__SNC__))
#	define DW_COMPILER_AUTODETECT         DW_COMPILER_SN
#elif (DW_PLATFORM_AUTODETECT == DW_PLATFORM_PS3_PPU || DW_PLATFORM_AUTODETECT == DW_PLATFORM_PS3_SPU)
#	define DW_COMPILER_AUTODETECT         DW_COMPILER_GCC
#else
#	define DW_COMPILER_AUTODETECT         DW_COMPILER_UNKNOWN
#endif

#endif // !DW_BASE_CONFIG_AUTO_DETECT_H
